#pragma once

#include <string>
#include <memory>
#include "stream/Topic.h"

namespace stream {
namespace impl {
namespace rocksdb {

class Meta;
class Data;

class Topic : public ::stream::Topic {
public:
	Topic(const std::string & name, const std::string & dir);

	~Topic()override;

	int append(const std::string & key, const std::string & value) override;

    bool get(const std::string & key, std::string & value) override;

    size_t size() const override;
	void clear() override;

protected:
	bool _open() override ;
	void _close() override ;
private:
	std::string _path;
	std::shared_ptr<Meta> _meta;
	std::shared_ptr<Data> _data;
};

}//end of namespace rocksdb
}//end of namespace impl
}//end of namespace stream
